package com.uuticketweb.ticket.user.service.factory;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.uuticketweb.ticket.user.service.UserService;

public class UserServiceFactory {
	private static UserService userService = null;
	public static synchronized UserService getUserService(){
		if(userService == null){
			ApplicationContext ct = WebApplicationContextUtils.getWebApplicationContext(
					ServletActionContext.getServletContext());
			userService = (UserService)ct.getBean("userService");
		}
		return userService;
	}
}
